#include <iostream>
#include <fstream>

#include "lexer.h"
#include "NewToken.hpp"

using namespace std;

int main()
{
    ifstream ifs("TestInput.txt", ifstream::binary|ifstream::ate);
    ifstream::pos_type pos = ifs.tellg();
    int length = pos;
    char* text = new char[length];
    ifs.seekg(0, ifstream::beg);
    ifs.read(text, length);
    ifs.close();


    Lexer lexer;
    lexer.init(text,length);

    Token t = lexer.nextToken();
    while (t.type != Token::Eof)
    {
        cout << t.getName() << "\n";
        t = lexer.nextToken();
    }


    cout << "Hello world!" << endl;
    return 0;
}
